﻿#include "EquipmentUpgrade.h"
#include "ui_equipmentupgrade.h"

EquipmentUpgrade::EquipmentUpgrade(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::EquipmentUpgrade)
{
    ui->setupUi(this);
    time = new QLabel(ui->frameBottom);
    time->setGeometry(10, 10, 200, 40);
    time->setStyleSheet("QLabel{font: 20px; color: rgb(25, 25, 112);}");
    signal = new QLabel(ui->frameBottom);
    signal->setGeometry(700, 18, 41, 22);
    signal->setStyleSheet("QLabel{background-color:transparent;}");

    QDir dir(IMAGE_PATH);
    if(dir.exists())
    {
        ui->frameTop->setStyleSheet(LOGO_STY);
    }

    connect(&this->timerLongPress, SIGNAL(timeout()), this, SLOT(onClickedLongCount()));
    connect(stackLayout, SIGNAL(currentChanged(int)), this, SLOT(ShowGunNum(int)));
}
void EquipmentUpgrade::ShowGunNum(int current)
{
    if(current == equipmentUpgradePage)
    {
        ui->_focus_gun_->setText(QString::number(focus_gun_));
    }
}
void EquipmentUpgrade::onClickedLongCount()
{
    timerLongPress.stop();
    /*待完成*/
    stackLayout->setCurrentIndex(deviceMaintaiceforLogingPage);
    focus_gun_ = 0;
}
EquipmentUpgrade::~EquipmentUpgrade()
{
    delete ui;
}


void EquipmentUpgrade::on_buttonLogo_pressed()
{
    timerLongPress.start(3000);
}

void EquipmentUpgrade::on_buttonLogo_released()
{
    timerLongPress.stop();
}
